package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StPhysicalTableMapper;
import com.ruoyi.system.domain.StPhysicalTable;
import com.ruoyi.system.service.IStPhysicalTableService;
import com.ruoyi.common.core.text.Convert;

/**
 * 物理表Service业务层处理
 * 
 * @author wmao
 * @date 2024-07-19
 */
@Service
public class StPhysicalTableServiceImpl implements IStPhysicalTableService 
{
    @Autowired
    private StPhysicalTableMapper stPhysicalTableMapper;

    /**
     * 查询物理表
     * 
     * @param id 物理表主键
     * @return 物理表
     */
    @Override
    public StPhysicalTable selectStPhysicalTableById(String id)
    {
        return stPhysicalTableMapper.selectStPhysicalTableById(id);
    }

    /**
     * 查询物理表列表
     * 
     * @param stPhysicalTable 物理表
     * @return 物理表
     */
    @Override
    public List<StPhysicalTable> selectStPhysicalTableList(StPhysicalTable stPhysicalTable)
    {
        return stPhysicalTableMapper.selectStPhysicalTableList(stPhysicalTable);
    }

    /**
     * 新增物理表
     * 
     * @param stPhysicalTable 物理表
     * @return 结果
     */
    @Override
    public int insertStPhysicalTable(StPhysicalTable stPhysicalTable)
    {
        stPhysicalTable.setCreateTime(DateUtils.getNowDate());
        return stPhysicalTableMapper.insertStPhysicalTable(stPhysicalTable);
    }

    /**
     * 修改物理表
     * 
     * @param stPhysicalTable 物理表
     * @return 结果
     */
    @Override
    public int updateStPhysicalTable(StPhysicalTable stPhysicalTable)
    {
        stPhysicalTable.setUpdateTime(DateUtils.getNowDate());
        return stPhysicalTableMapper.updateStPhysicalTable(stPhysicalTable);
    }

    /**
     * 批量删除物理表
     * 
     * @param ids 需要删除的物理表主键
     * @return 结果
     */
    @Override
    public int deleteStPhysicalTableByIds(String ids)
    {
        return stPhysicalTableMapper.deleteStPhysicalTableByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除物理表信息
     * 
     * @param id 物理表主键
     * @return 结果
     */
    @Override
    public int deleteStPhysicalTableById(String id)
    {
        return stPhysicalTableMapper.deleteStPhysicalTableById(id);
    }
}
